<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>工段信息</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
 </head>
 <body style="overflow-y: hidden" scroll="no">
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="sectionController.do?save">
			<input id="id" name="id" type="hidden" value="${sectionPage.id }">
			<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							工段编号:
						</label>
					</td>
					<td class="value">
						<input class="inputxt" id="sectionCode" name="sectionCode" ignore="ignore"
							   value="${sectionPage.sectionCode}">
						<span class="Validform_checktip"></span>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							工段名称:
						</label>
					</td>
					<td class="value">
						<input class="inputxt" id="sectionName" name="sectionName" ignore="ignore"
							   value="${sectionPage.sectionName}">
						<span class="Validform_checktip"></span>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							工段类别:
						</label>
					</td>
					<td class="value">
						<select id="sectionCategory" name="sectionCategory"  >
						</select>
						<span class="Validform_checktip"></span>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							职位:
						</label>
					</td>
					<td class="value">
						<input class="inputxt" id="position" name="position" ignore="ignore"
							   value="${sectionPage.position}">
						<span class="Validform_checktip"></span>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							负责人姓名:
						</label>
					</td>
					<td class="value">
						<input class="inputxt" type="hidden" id="headId" name="headId" ignore="ignore" value="${sectionPage.headId}">
						<input class="inputxt" id="headName" name="headName" ignore="ignore" value="${sectionPage.headName}">
						<span class="Validform_checktip"></span>
					</td>
				</tr>
			</table>
		</t:formvalid>
<script type="text/javascript">
$(
		$.ajax({
			type : "post",
			url : "sectionController.do?getSeccate&type=${type}",
			success : function(data) {
				var dataObj = eval("(" + data + ")");
				for (var num = 0; num < dataObj.length; num++) {
					var code = dataObj[num].code;
					var opt;
					if('${type}'==code || '${sectionPage.sectionCategory}'==code){
						opt = "<option selected='selected' value='" + dataObj[num].code + "'>" + dataObj[num].name + "</option>";
					}else{
						opt = "<option value='" + dataObj[num].code + "'>" + dataObj[num].name + "</option>";
					}
					$("#sectionCategory").append(opt);
				}
			}
		})
		)
</script>
 </body>